<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>Title</title>
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script>
        function calculate() {
            var price =parseFloat(${pathInfo.price}) ;
            var num = parseInt(document.getElementById('num').value);
            if (num > 0){
                total.value = parseFloat(num*price);
            }
        }
    </script>
</head>
<body>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>新增用户</h1>
            </div>
        </div>
        <div class="row">
            <div class="col-md-4 colum">
                <a class="btn btn-default href="${pageContext.request.contextPath}/user/toAddPage">新增书籍</a>
            </div>
        </div>
    </div>

    <form action="${pageContext.request.contextPath}/user/addOrder" method="post">
        <div class="form-group">
            <label>路线名：${pathInfo.pathname}</label>
        </div>
        <div class="form-group">
            <label>简介：${pathInfo.intro}</label>
        </div>
        <div class="form-group">
            <label>所去城市：${pathInfo.province}省 ${pathInfo.city} 市</label>
        </div>
        <div class="form-group">
            <label>单价：${pathInfo.price} 元</label>
        </div>
        <div class="form-group">
            <label>天数： ${pathInfo.daytime}天</label>
        </div>
        <div class="form-group">
            <input type="hidden" name="pid" class="form-control" id="pid" value="${pathInfo.pid}" required>
        </div>
        <div class="form-group">
            <label for="num">数量</label>
            <input type="number" name="num" class="form-control" id="num" onchange="calculate()" required>
        </div>
        <div class="form-group">
            <label>总价: </label>
            <input id="total" type="text" name="total"  class="form-control" readonly/>
        </div>
        <div class="form-group">
            <label for="startDate">日期</label>
            <input type="date" name="startDate" class="form-control" id="startDate" required>
        </div>
        <button type="submit" class="btn btn-default">提交订单</button>
    </form>
</div>

</body>
</html>

